DU
Section: User Commands (1)
Index
Return to Main Contents
NAME
du - Enhanced disk usage summary.
SYNTAX
du
[ options ] [ name ... ]
DESCRIPTION
Du
determines the number of disk blocks used by
name.
If
name
is a directory, then
du
recursively descends down the directory accumulating and reporting the
disk usage at each subdirectory. The usage at a directory will include
the usage of all its subdirectories.
Since the usage is reported only at directories, no result will be printed
if
name
is a regular file. (This may be changed with the
-a
and
-s
options described below.) If no
name
is specified, then
du
provides the usage at the current working directory.
Du
keeps track of files which contain multiple links, and counts such files
only once. Large files require filesystem overhead called ``indirect
blocks''. These blocks will be included as well as the actual data (direct)
blocks in the usage statistics.
Filesystem storage is allocated in groups called ``blocks'', and the block
size may be a filesystem dependent value.
Du
calculates the size of an entry in terms of the native filesystem block
size, but may scale the reported results to a ``reporting'' blocksize.
This ensures that entry sizes are calculated correctly, and reported
consistently. The help option
(-h)
will indicate the default reporting blocksize. The
-b
option can change this value.
The following options modify the behavior of
du:
- -a
-
The usage of all items (i.e. regular files as well as directories) is
reported.
- -b size
-
The usage is reported in terms of disk blocks size bytes instead
of the actual disk block size of the filesystem. If zero is specified,
conversion to a reporting blocksize is suppressed, and the values reported
are the actual number of blocks used.
- -c n,...
-
This option requests that
du
provides a breakdown of the disk usage by age rather than a single total.
Each argument specifies a number of days.
Du
will print one column per argument showing the usage by files that many
days or older. For example, the command:
-
du -c 0,7,30
will start at the current directory and display the total usage, the usage
by files a week or older, and the usage of files a month or older. The
file's modification time is used to provide this breakdown.
- -d
-
This option prevents
du
from descending into directories encountered. It will count the space
used by the directory information, but will not examine the contents of
that directory.
- -f
-
This option will prevent
du
from descending down into a directory if that action requires crossing
onto another filesystem.
- -h
-
Displays a help summary.
- -i
-
Do not accumulate subdirectories' usage into the parent directory's usage.
For example, if you run the USENET news software, you could perform a
command similar to:
-
du -i /usr/spool/news
to determine the disk space used by each newsgroup without accumulating,
for example, the
comp.unix.xenix
newsgroup usage in with the
comp.unix
newsgroup usage.
- -l
-
Normally
du
will count a file with multiple links only once. With this option,
du
will count the file each time is is encountered.
- -r
-
Normally,
du
does it's work silently and will not report any errors (i.e. a
name
specified on the command line doesn't exist or you don't have permissions
to check a directory). When this option is specified, such errors will
be reported.
(Note:
On some systems the default will be to changed to display errors, in which
case this option will have no effect.)
- -s
-
Prints only a grand total for each
name
on the command line.
- -u
-
Causes multiply linked files to be skipped entirely and omitted from the
usage statistics.
BUGS
Du
will report files with holes in them (sparse files) incorrectly.
Anything but a regular file or directory (e.g. special files, FIFOs, etc.)
will be silently ignored.
If the actual filesystem blocksize is not an integral multiple of the
reporting blocksize
(-b)
then roundoff errors will occur in the translation.
Du
will round up in this case.
AUTHOR
Chip Rosenthal
<chip@chinacat.Unicom.COM>
Copyright 1990, Unicom Systems Development. All rights reserved.
See distributed README file for terms of distribution and use.
Index
- NAME
-
- SYNTAX
-
- DESCRIPTION
-
- BUGS
-
- AUTHOR
-
This document was created by
man2html,
using the manual pages.
Time: 22:34:59 GMT, January 18, 2023